package com.example.mvpdemo2;

import com.example.mvpdemo2.mvpBase.BaseModule;
import com.example.mvpdemo2.appInterface.LoginInterface;

public class LoginModule extends BaseModule<LoginPresenter,LoginInterface.M> {

    public LoginModule(LoginPresenter mPresenter) {
        super(mPresenter);
    }

    @Override
    public LoginInterface.M getContract() {
        return new LoginInterface.M() {
            @Override
            public void requestLogin(String name, String password) throws Exception {
                if("abc".equals(name) && "123".equals(password))
                {
                    mPresenter.getContract().responseLogin(true);
                }
                else
                {
                    mPresenter.getContract().responseLogin(false);
                }
            }
        };
    }


//    @Override
//    public void requestLogin(String name, String password) throws Exception {
//        if("abc".equals(name) && "123".equals(password))
//        {
//            mPresenter.responseLogin(true);
//        }
//        else
//        {
//            mPresenter.responseLogin(false);
//        }
//    }
}
